<?php namespace app\system\controller;

use app\admin\controller\Common;
use houdunwang\request\Request;
use system\model\Config as ConfigModel;

class Config extends Common    {
    public function __construct()
    {

        $this->auth();
    }

    //动作
    public function setting(ConfigModel $config){
        if (IS_POST){
            $config->setConfig(Request::post());
            return $this->setRedirect('refresh')->success('操作成功');
        }
        //此处书写代码...
        //return view();
        $model=ConfigModel::find(1);
        $field = $model ? json_decode($model['system'],true) : [];
        return view ('', compact('field'));
    }
}
